package com.xl.sst.controller;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xl.sst.biz.OrderBiz;
import com.xl.sst.vo.Order;


/*
 * 订单处理层
 * yue
 */
@Controller
@RequestMapping("/view")
public class OrderController {
	@Resource
	public OrderBiz orderBiz;
	public OrderBiz getOrderBiz() {
		return orderBiz;
	}
	public void setOrderBiz(OrderBiz orderBiz) {
		this.orderBiz = orderBiz;
	}
	/*
	 * 点击立即购买 或 在购物车生成订单时候创建订单
	 * 
	 */
	@RequestMapping("/orderAdd.do")
	public String orderAdd(Order o){
		//当前时间毫秒值生成订单编号
		String s = String.valueOf(new Date().getTime()); 		
		o.setBianhao(s);
		if(orderBiz.orderAdd(o)){
			return null;
		}else{
			return null;
		}
	}
}
